package cn.com.gome.sn.web.util;

import cn.com.gome.frame.logger.HLogger;
import cn.com.gome.frame.logger.LoggerManager;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.gome.service.CacheService;

public class TestGcache {

	public static final HLogger logger = LoggerManager.getLoger("TestGcache");

	private static ApplicationContext context = null;

	public synchronized static void test() {
		context = new ClassPathXmlApplicationContext(new String[] {"classpath:applicationContext.xml"});
		logger.info("inits....................................");
		CacheService cacheService = (CacheService) context.getBean("cacheService");
		//String business = "GRRD";//测试的businessType
		String business = "FINC_PAY_CACHE";//金融系统部测试开发用Cache
        String setValue = cacheService.set(business, "tkkk", "testvalue");
		logger.info("set value=[" + setValue + "]");
        
        String getValue = cacheService.get(business, "tkkk");
		logger.info("get value=[" + getValue + "]");
        getValue = cacheService.get(business, "tk2");
		logger.info("get value=["+getValue+"]");
		
	}
	
	public static void main(String[] args) {
		test();
	}

}
